﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using Antu.WebControls;
using Antu.Core.Components;
using Antu.Core.Services;
using System.Web.UI.WebControls;
using EluZSProvider;
using System.Web;
using System.Data;

namespace WebSys.UI.Control.ZhengShou
{
    public class SetXieYiFsControl : MPBasicTemplate
    {
        EluZSDataProvider _EluZSDataProvider = (EluZSDataProvider)ProviderService.ProviderServiceMange.GetProvider("EluZSProvider");
        public string userid = string.Empty;
        protected override void OnLoad(EventArgs e)
        {
            if (HttpContext.Current.Session["UserID"] == null)
            {
                Antu.Utilities.UtilitiesPage.AlertDialogClear("登录超时，请重新登录！", "window.parent.location.href('../login.aspx');");
            }
            else
            {
                userid = HttpContext.Current.Session["UserID"].ToString();
            }
            base.OnLoad(e);
            DropDownList setXieYi = (DropDownList)FindControl("setXieYi");
            if (!base.Page.IsPostBack)
            {
                setXieYi.SelectedValue = _EluZSDataProvider.GetSomeStr("ZS_USER", "TABFS", "ID", userid);
            }
            Button BtnSave = (Button)FindControl("BtnSave");
            BtnSave.Click += new EventHandler(BtnSave_Click);
        }

        protected void BtnSave_Click(object sender, EventArgs e)
        {
            DropDownList setXieYi = (DropDownList)FindControl("setXieYi");
            _EluZSDataProvider.UpdateSomething("ZS_USER", "TABFS", setXieYi.SelectedValue, "ID", userid);
            base.Page.Response.Write("<script>window.location.href=location.href;</script>");
        }
    }
}


